<template>
	<view class="introduce">
		<rich-text :nodes="allData.introduce"></rich-text>
		<view class="examination">
			<button class="examination-btn">查看结果</button>
			<button class="examination-btn" @click="getDetail">开始测试</button>
			<button class="examination-btn">分享</button>
		</view>
	</view>
</template>

<script>

	export default {
		data() {
			return {
				allData: {}
			}
		},
		
		onLoad: function(option) {
			let vm = this
			const eventChannel = this.getOpenerEventChannel()
			// 监听acceptDataFromOpenerPage事件，获取上一页面通过eventChannel传送到当前页面的数据
			eventChannel.once('afferentintroduce', function(data) {
				uni.setNavigationBarTitle({
					title: data.data.typename
				});
				vm.allData = data.data
			})
		},
		methods: {
			getDetail() {
				let questiontype_id = this.allData.questiontype_id
				uni.navigateTo({
					url: '../answer/answer?id=' + questiontype_id
				})
			}
		}
	}
</script>

<style>
	.introduce {
		margin: 20px;
	}

	.examination-btn {
		width: 100px;
		height: 40px;
		line-height: 40px;
		border-radius: 20px;
		margin-top: 10px;
		background-color: #FFFFFF;
	}
</style>
